﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace S_Incident.Infrasturctre
{
    public class DapperContext
    {
        public string connectionString;
        //通过在数据库上下文类中定义这样一个属性，可以将数据库连接对象存储在该属性中，并在需要执行数据库操作时直接使用这个连接对象
        public IDbConnection Command {  get; set; }
        public DapperContext(string settings)
        {
            connectionString = settings;
            Command=new MySqlConnection(connectionString);
        }
    }
}
